<?php

class FeedbackController extends Zend_Controller_Action
{
	public function indexAction()
	{
		$service = new FeedbackService();
		if ($this->getRequest()->isPost ()) {
			if($service->store())
			{
				$this->_redirect("/site/index/");exit;
			}
			else
			{
				$this->view->errorList = $service->getErrorMsg();
				print_r($this->view->errorList);exit;
				$this->view->feedback = $_POST;
			}
		}
		
		$contentService = new ContentService();
		$feedback = $contentService->getFeedback();
		$this->view->content = $feedback;
	}
}